Make gtk_widget_get_path() also add all persistent style classes the widget has.
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 17 Jan 2011 03:05:44 +0000 (04:05 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 17 Jan 2011 03:44:03 +0000 (04:44 +0100)
gtk/gtkwidget.c

index 325788b943dd2496f4a259ffe1121f172316250a..40ec6040a85cc0bcae9fc0aeafed94c324c556fa 100644 (file)
@@ -14122,8 +14122,22 @@ gtk_widget_get_path (GtkWidget *widget)
         gtk_widget_path_iter_set_name (widget->priv->path, pos, widget->priv->name);
 
       if (widget->priv->context)
-        gtk_style_context_set_path (widget->priv->context,
-                                    widget->priv->path);
+        {
+          GList *classes, *l;
+
+          /* Also add any persistent classes in
+           * the style context the widget path
+           */
+          classes = gtk_style_context_list_classes (widget->priv->context);
+
+          for (l = classes; l; l = l->next)
+            gtk_widget_path_iter_add_class (widget->priv->path, pos, l->data);
+
+          gtk_style_context_set_path (widget->priv->context,
+                                      widget->priv->path);
+
+          g_list_free (classes);
+        }
     }
 
   return widget->priv->path;